package com.sweet.page;

import lombok.Getter;

/**
 * 分页
 *
 * @author limi
 * @create 2018-03-19-15:47
 */
@Getter
public final class Pageable {
    private int number;    //分页页码
    private int size;      //每页展示量

    public Pageable(int number, int size) {
        if (number < 1) {
            throw new IllegalArgumentException("Page number must not be less than one!");
        }

        if (size < 1) {
            throw new IllegalArgumentException("Page size must not be less than one!");
        }

        this.number = number;
        this.size = size;
    }
}